public class BankAccount {
    private double balance;
//    初始化余额
    public BankAccount(double initialBalance){
        this.balance=initialBalance;
    }
    //存钱
    public void deposit(double amount){
        balance+=amount;
        System.out.println("余额:"+balance);
    }
    //取钱
    public void withdraw(double amount){
        balance=balance-amount-amount*0.001;
        System.out.println("余额:"+balance);
    }
    public double getBalance(){
        return balance;
    }
}
